Repository navigation
fix(start-plan): system blocks + proactive jsdom captcha - #4
yurchik228336 wants to merge 1 commit into
Conversation
…ptcha Fixes TriDefender#2 — start-plan /v1/messages returned 3007 without captcha and 3012 with solved captcha but missing ZCode gateway system blocks. - Prepend official system blocks on every start-plan Anthropic request - Proactive traceless Aliyun captcha via jsdom (scene 11xygtvd), ~45s cache - Bearer JWT auth for start-plan; retry once on captcha rejection
|
I am reviewing this and comparing it to a local (not pushed) patch will be back shortly |
Code reviewFound 4 issues:
zcode-api/src/proxy/handler.ts Lines 183 to 186 in 20bde39
Lines 7 to 8 in 20bde39
zcode-api/src/proxy/handler.ts Lines 228 to 233 in 20bde39
zcode-api/src/proxy/system-prompt.ts Lines 24 to 26 in 20bde39 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
There's one useful thing tho, upstream needs Authorization: Bearer {jwt}, which is different from current code. I'm currently checking with original zcode source file to see the exact usage |
|
R5("buildStartPlanRuntimeAuthorizationHeaders") — Only works on zaiStartPlan / bigmodelStartPlan provider ,returns{ Authorization: "Bearer {jwt}" }, |
|
Hey I will push some new updates into the auto-captcha branch soon and hope you will test then. I did learn two items from your PR, the Bearer JWT and the json prompt file instead of hardcoding are both nice to have. However before actually pushing I would like to have more information of that system-prompt thing on zcode.
I know it may be too much to ask and indeed it's hard to prove. |
|
Agreed with actual results, coding plan does not require sys prompt injection, I would gather community A/B test results to see. Since GLM billing had always been obscure: They always uses words like |
|
Incorporated commit inspired by your ideas, contribution acknowleged. |
Summary
Fixes #2 — start-plan JWT works on billing but
/v1/messagesfailed with:This PR ports a tested fix (verified live against zcode.z.ai):
11xygtvd): cache ~45s, attachx-aliyun-captcha-verify-parambefore request, re-solve + retry once on captcha rejectionReplaces Playwright-based reactive-only captcha flow on
auto-captchawith a lighter jsdom solver that matches ZCode desktop behaviour.Test plan
cd captcha_node && npm installnode scripts/test-start-plan.mjs— captcha + chat with system blocks → HTTP 200, model reply receivedplan: start-plan+ OAuth JWT →POST /v1/messagesstreams successfully